package tech.mhuang.pacebox.core.map;

import java.util.Objects;

public class KeyValue<K, V> {

    private K key;

    private V value;

    public K getKey() {
        return key;
    }

    public void setKey(K key) {
        this.key = key;
    }

    public V getValue() {
        return value;
    }

    public void setValue(V value) {
        this.value = value;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o){
            return true;
        }
        if (o == null || getClass() != o.getClass()){
            return false;
        }
        KeyValue<?, ?> keyValue = (KeyValue<?, ?>) o;
        return key.equals(keyValue.key);
    }

    @Override
    public int hashCode() {
        return Objects.hash(key);
    }
}
